﻿namespace classify
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一行字符：");
            string input = Console.ReadLine();

            int letters = 0;
            int digits = 0;
            int spaces = 0;
            int others = 0;

            foreach (char c in input)
            {
                if (char.IsLetter(c))
                {
                    letters++;
                }
                else if (char.IsDigit(c))
                {
                    digits++;
                }
                else if (char.IsWhiteSpace(c))
                {
                    spaces++;
                }
                else
                {
                    others++;
                }
            }

            Console.WriteLine($"英文字母: {letters}");
            Console.WriteLine($"数字: {digits}");
            Console.WriteLine($"空格: {spaces}");
            Console.WriteLine($"其他字符: {others}");
        }
    }
}
